Is it possible for gtkdialog to update the window using new content instead of having to close and open a new window?
I need a script where I press a button (options) to open up a new dialog -WITHIN- the existing one, exchanging the current dialog.
OPTION_DIALOG='
<window>
<vbox>
<button><label>Back to Main</label><action>CHANGE_SCRIPT: MAIN</action></button>
</vbox>
</window>
'
MAIN_DIALOG='
<window>
<vbox>
<button><label>Options</label><action>CHANGE_SCRIPT: OPTION_DIALOG</action></button>
</vbox>
</window>
'
Possible or not?
Cheers.
Gtkdialog update script window, not open a new one?
From what I know it's not possible to replace widgets in already opened window, but you can always prepare various GUIs on subsequent tabs of <notebook> widget and switch between them, e.g.:
Greetings!
Code: Select all
#!/bin/bash
export PAGE=/tmp/notebook_page_${$}
echo 0 > $PAGE
trap 'rm $PAGE' EXIT
export MAIN='
<window>
<notebook show-tabs="false">
<vbox>
<text><label>This is first page</label></text>
<checkbox><label>some checkbox</label></checkbox>
<entry><default>some entry</default></entry>
<edit><default>edit field</default></edit>
<button>
<label>Show Options</label>
<action>echo 1 >${PAGE}</action>
<action>refresh:NOTEBOOK</action>
</button>
</vbox>
<vbox>
<text><label>This is second page</label></text>
<radiobutton></radiobutton>
<tree><item>some</item><item>tree</item></tree>
<button>
<label>Back to main</label>
<action>echo 0 > ${PAGE}</action>
<action>refresh:NOTEBOOK</action>
</button>
</vbox>
<variable>NOTEBOOK</variable>
<input file>'${PAGE}'</input>
</notebook>
</window>'
gtkdialog -p MAIN
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
[b][color=green]Omnia mea mecum porto.[/color][/b]
I did an example with a togglebutton widget
Clicking on the toggle button changed the window and changed the
label of the button that did the toggling.
http://murga-linux.com/puppy/viewtopic.php?t=91989
_____________________________________________________
Clicking on the toggle button changed the window and changed the
label of the button that did the toggling.
http://murga-linux.com/puppy/viewtopic.php?t=91989
_____________________________________________________
The vbox hiding works, but I cannot make the other "dialog" appear with same method, so I guess I'm sticking with the notebook-widget.
I need some help with some problems I'm having trying to style a checkbox. I want to have a flat checkbox without focus colors, which I've managed through widget_class Checkbutton, but I want to have different colors on certain checkbutton labels.
For example, I want one checkbutton with gtklabel normal grey and highlight black. On the other dialog I want a checkbutton with normal black and no hightlight.
As a workaround I've made a checkbox widget with a blank label, then put a text widget on front of that, but I want the text to act as a toggle so hopefully I can get this sorted out.
Cheers.
I need some help with some problems I'm having trying to style a checkbox. I want to have a flat checkbox without focus colors, which I've managed through widget_class Checkbutton, but I want to have different colors on certain checkbutton labels.
For example, I want one checkbutton with gtklabel normal grey and highlight black. On the other dialog I want a checkbutton with normal black and no hightlight.
As a workaround I've made a checkbox widget with a blank label, then put a text widget on front of that, but I want the text to act as a toggle so hopefully I can get this sorted out.
Cheers.