Page 55 of 76

Posted: Sun 22 May 2016, 18:29
by step
zigbert wrote:block-function-signals was introduced after my request. See
http://www.murga-linux.com/puppy/viewto ... 704#544704
So, based on this, my understanding is that the motivation for using block-function-signals is function and not performance. Set it true to fence off actions that do not correspond to manual user changes. For example set it true if you want to trigger the skip forward/backward action only when a user changes the slider value (by dragging it) and for no other reason. Hopefully I'm getting it right.

Posted: Mon 11 Jul 2016, 01:52
by recobayu
Can we cange label based on entry? I mean when we change text on entry, the label change directly live perform.

Posted: Mon 11 Jul 2016, 09:16
by trio
recobayu wrote:Can we cange label based on entry? I mean when we change text on entry, the label change directly live perform.
edit: ini mgkn yg anda mau

Code: Select all

#!/bin/bash -a

function echotext ()
{
echo "$NEWTEXT" > /tmp/text.txt
}
echo "OLD TEXT" > /tmp/text.txt 
export GUI="
<window title="Auto" icon-name="gtk-edit">
<vbox>
	<timer milliseconds="true" interval="200" visible="false">
      <action type="refresh">TEXT</action>
      <action type="refresh">NEWTEXT</action>
      </timer>
	<text>
	<input>cat /tmp/text.txt</input><variable>TEXT</variable>
	</text>
		<entry>
		<variable>"NEWTEXT"</variable>
		<action>echotext &</action>
		</entry>
</vbox>
</window>"		
gtkdialog --program=GUI
lihat widget timer nya ... selamat mencoba

Posted: Tue 12 Jul 2016, 03:32
by recobayu
Terima kasih mas Trio..
Saya nyoba sendiri bisa ternyata. Alhamdulillah..

Code: Select all

#!/bin/sh
echo > labelku
export a='<window>
<vbox>
 <entry>
  <action signal="changed">echo $e > labelku</action>
  <action signal="changed">refresh:t</action>
  <variable>e</variable>
 </entry>
 
  <text>
   <input file>labelku</input>
   <variable>t</variable>
  </text>
</vbox> 
</window>'
gtkdialog -p a
Lebih cepet malahan.. :D

Posted: Tue 12 Jul 2016, 06:43
by trio
Mantap

Code: Select all

<action signal="changed">

Posted: Sat 13 Aug 2016, 15:40
by jlst
how do i make a dialog show maximized?

Posted: Sat 13 Aug 2016, 16:03
by zigbert
I don't know how to do this in GTK, but there is a workaround setting a JWM class

from the first post:
---------------------------------------------------------------
Override JWM-settings - skip taskbar, sticky, layer, border
This is how to override default settings in your JWM configuration.

Your gtkdialog gui must be called with the --class parameter

Code: Select all

gtkdialog --class=APPLET -f myfile
Then this code must be in your jwm configuration file - $HOME/.jwmrc (to be set permanently, it must be added to /etc/xdg/templates/_root_.jwmrc)

Code: Select all

<Group>
 <Class>APPLET</Class>
 <Option>nolist</Option>
 <Option>sticky</Option>
 <Option>noborder</Option>
 <Option>layer:12</Option>
</Group>
>> The option 'nolist' does avoid your app showing up in the taskbar.
>> The option 'sticky' shows your app on all desktops.
>> The option 'noborder' is equal to the gtkdialog attribute <window decorated="false">.
>> The option 'layer:x' defines if other windows should cover your app, or if it should be on top. layers can be 0-12 where 12 is the on-top setting.

Posted: Sun 14 Aug 2016, 02:01
by MochiMoppel
jlst wrote:how do i make a dialog show maximized?
Unlike yad gtkdialog doesn't seem to have a way to set a window to maximized state, but you could use gtkdialog's geometry option -G to achieve almost the same effect:
  • #! /bin/sh
    XWININFO=$(xwininfo -root)
    GEOMETRY=${XWININFO#*-geometry }
    echo '
    <window allow-shrink="true">
    <text label="Dialog set to geometry '$GEOMETRY'" space-expand="true"></text>
    </window>'|gtkdialog -G $GEOMETRY -s


Above example uses the command xwininfo -root to read the geometry of the root window, which happens to be the maximum window size. The window manager honors this size - minus the size it may need for its tray. The result should be visually the same as a maximized window.

The geometry option actually sets the minimum size, i.e. the user can't resize the window smaller. Use the allow-shrink="true" option if you need unrestricted resizing.

Posted: Sun 14 Aug 2016, 03:48
by B.K. Johnson
Hi all
How do I create a dialogbox with gtkdialog or yad or zenity which displays text, but shows neither Cancel nor OK button, and with a timeout so that the box vanishes after a specified timeout interval?

Posted: Sun 14 Aug 2016, 03:51
by jlst
thanks for the advice. for such a complex and complete gtk gui... this is outrageous

gtkdialog has the --center option. well, center, maximized... i guess these are gtk window properties. i mean this could be implemented replicating the --center option, changing one line perhaps..

i remember asking the yad developer to add the --no-escape option to make yad dialogs behave gtkdialog, and basically the opposite can be applied to gtkdialog.

there are patches for everything somewhere, i actually found one that was submitted like 2-3 years before it got applied!
https://sourceforge.net/p/yad-dialog/tickets/253/

Posted: Sun 14 Aug 2016, 04:07
by Sailor Enceladus
B.K. Johnson wrote:Hi all
How do I create a dialogbox with gtkdialog or yad or zenity which displays text, but shows neither Cancel nor OK button, and with a timeout so that the box vanishes after a specified timeout interval?
In Puppy I see they use yaf-splash a lot for those, but maybe that's not what you want?

Code: Select all

yaf-splash -bg pink -placement top -close never -timeout 5 -text "This message will self-destruct in 5 seconds"

Posted: Sun 14 Aug 2016, 04:21
by B.K. Johnson
@Sailor Enceladus
Thanks for responding.
You are correct that I don't want this:

Code: Select all

yaf-splash -bg pink -placement top -timeout 5 -text "This message will self-destruct in 5 seconds

Posted: Sun 14 Aug 2016, 06:49
by Geoffrey
B.K. Johnson wrote:Hi all
How do I create a dialogbox with gtkdialog or yad or zenity which displays text, but shows neither Cancel nor OK button, and with a timeout so that the box vanishes after a specified timeout interval?
This works as a message box.

Code: Select all

yad --title="Yad Message Box" --fixed --text-align="center" --skip-taskbar --window-icon="gtk-dialog-info" \
--text="<big><b>
This is a Yad message box
</b></big>" --no-buttons --timeout="3"

Posted: Sun 14 Aug 2016, 06:52
by mcewanw
You can create a splash in gtkdialog by using a progress bar - just put a sleep inside that and after force the progress bar to complete to its 100 total. Sorry, I don't have the exact code at my fingertips just now. The progress bar itself can be constructed with <invisible> tags or something like that.

EDIT: Actually, just noted that zigbert gives a splash screen example in his first post of this thread - near the end of his post.

William

Posted: Sun 14 Aug 2016, 07:22
by Geoffrey
This works for gtkdialog, Ah it does skip the taskbar using skip_taskbar_hint="true"

Code: Select all

#! /bin/bash
TEXT="<big><b>
This is a gtkdialog message box
</b></big>"

export Message_Box='	
<window title="Message Box" icon-name="gtk-dialog-info" resizable="false" skip_taskbar_hint="true">
<vbox>
<text wrap="false" xalign="0" use-markup="true">
			<label>"'$TEXT'"</label>
			</text>
</vbox>
<timer seconds="true" interval="5" visible="false">
    <action>EXIT:exit</action>
    </timer>
</window>'
gtkdialog --program=Message_Box

Posted: Sun 14 Aug 2016, 14:35
by B.K. Johnson
@Geoffrey
Thanks for those 2 examples.

Bonus question:
What's the definitive link for yad commands. I did not see "timeout" and "no-buttons" anywhere I looked?

Posted: Sun 14 Aug 2016, 19:27
by Wognath
What's the definitive link for yad commands.
http://smokey01.com/help/yad-tips-0.0.1.ncd.tar.xz

Posted: Sun 14 Aug 2016, 19:34
by B.K. Johnson
@Wognath
Thanks for the link.

Posted: Sun 14 Aug 2016, 21:42
by Geoffrey
B.K. Johnson wrote: I did not see "timeout" and "no-buttons" anywhere I looked?
In the terminal type either of these.

Code: Select all

Help Options:
  -h, --help                                     Show help options
  --help-all                                     Show all help options
  --help-general                                 Show general options
  --help-common                                  Show common options
  --help-calendar                                Show calendar options
  --help-color                                   Show color selection options
  --help-dnd                                     Show drag-n-drop options
  --help-entry                                   Show text entry options
  --help-file                                    Show file selection options
  --help-font                                    Show font selection options
  --help-form                                    Show form options
  --help-icons                                   Show icons box options
  --help-list                                    Show list options
  --help-multi-progress                          Show multi progress bars options
  --help-notebook                                Show notebook dialog options
  --help-notification                            Show notification icon options
  --help-paned                                   Show paned dialog options
  --help-picture                                 Show picture dialog options
  --help-print                                   Show print dialog options
  --help-progress                                Show progress options
  --help-scale                                   Show scale options
  --help-text                                    Show text information options
  --help-filter                                  Show file filter options
  --help-misc                                    Show miscellaneous options
  --help-gtk
The general help options show the commands you seek.

Code: Select all

# yad --help-general
Usage:
  yad [OPTION...] - Yet another dialoging program

General options
  --title=TITLE                                  Set the dialog title
  --window-icon=ICONPATH                         Set the window icon
  --width=WIDTH                                  Set the width
  --height=HEIGHT                                Set the height
  --geometry=WxH+X+Y                             Set the window geometry
  --timeout=TIMEOUT                              Set dialog timeout in seconds
  --timeout-indicator=POS                        Show remaining time indicator (top, bottom, left, right)
  --text=TEXT                                    Set the dialog text
  --text-align=TYPE                              Set the dialog text alignment (left, center, right, fill)
  --image=IMAGE                                  Set the dialog image
  --image-on-top                                 Show image above main widget
  --icon-theme=THEME                             Use specified icon theme instead of default
  --expander=TEXT                                Hide main widget with expander
  --button=NAME:ID                               Add dialog button (may be used multiple times)
  --no-buttons                                   Don't show buttons
  --buttons-layout=TYPE                          Set buttons layout type (spread, edge, start, end or center)
  --no-markup                                    Don't use pango markup language in dialog's text
  --no-escape                                    Don't close dialog if Escape was pressed
  --borders=NUMBER                               Set window borders
  --always-print-result                          Always print result
  --selectable-labels                            Dialog text can be selected
  --sticky                                       Set window sticky
  --fixed                                        Set window unresizable
  --on-top                                       Place window on top
  --center                                       Place window on center of screen
  --mouse                                        Place window at the mouse position
  --undecorated                                  Set window undecorated
  --skip-taskbar                                 Don't show window in taskbar
  --maximized                                    Set window maximized
  --fullscreen                                   Set window fulscreen
  --no-focus                                     Don't focus dialog window
  --splash                                       Open window as a splashscreen
  --plug=KEY                                     Special type of dialog for XEMBED
  --tabnum=NUMBER                                Tab nubmer of this dialog
  --parent-win=XID                               XID of parent window
  --kill-parent=SIGNAL                           Send SIGNAL to parent
  --print-xid                                    Print X Window Id to the stderr
  --image-path=PATH                              Add path for search icons by name

Posted: Mon 15 Aug 2016, 03:02
by B.K. Johnson
That is just wonderful Geoffrey.
Greatly appreciated.